text:
Q: Avoid newline when using raiserror Suppose I debug using raiserror, like so:
raiserror('Trying to do something...',0,0) with nowait

(queries that do something)

raiserror('Done.',0,0) with nowait

It would be handy to have this output in the "Messages" of SSMS in a single line:
Trying to do something...Done.
Is there a way? I haven't found anything around

A: No, either you wait until both actions are complete and print a single line with one call, or you have the output on two lines. SSMS (and ADS) just aren't equipped to do what you want to do.


text:
Q: PHP imap library - how to get headers value I fallow to:
https://github.com/ddeboer/imap/blob/master/src/Message/Headers.php

I try get:
'status' => $message->getHeaders()->get('reply_to'),
But I get issue:
`Severity: Notice

Message: Array to string conversion

Filename: database/DB_driver.php

Line Number: 1471
Error Number: 1054

Unknown column 'Array' in 'field list'
...
..
..
**Array**, 'new')`

How to correct get value reply_to ?
I need to check if this is new message or this is reply on message.

redpajama_set_name: RedPajamaStackExchange


text:
Q: data points on MATLAB figure is moving while panning the figure I am using MATLAB 2018b and using rlocus function to plot some function. In the figure I have to select some data points based on specific values. But When I zoom in and select a data point it remains in the exact position. But when I try to move the figure with pan option or zoom out the selected point moves relatively. I want these data points to remain in that specific position. But I can't stop this relative scaling of axis. My code is:
clear all
close all
clc
Gs=zpk([-8],[-3 -6 -10],1)
rlocus(Gs)


text:
Q: Auto-Update Field Based on Calculation I need some help coding a php calculator.. The Algorithm is a little complicated and I would like for the 3rd "Payment" field to auto-update with the result..
The math goes like this:  **$payment**=SUM(**$balance***0.0435)/12+(**$credit***0.0025)/12
(This algorithm outputs a Secured LOC Payment for a Mortgage)
So I am needing help calculating the $payment value via php for a web-page. Also I would like for the $payment field to auto-update with the calculated total..
Here is a excel document doing exactly what I need to create for the web: http://www.dev.jomilla.net/FNCals/SCFC_Secured%20LOC%20Payment%20Calculator_2013%2005%2023.xlsx
My Fields are written as
<form>
<input name="credit" id="credit" type="text" >
<input name="balance" id="balance" type="text" >
<input name="payment" id="payment" class="form-control">
</form>

Please help me calculate and auto-populate the result.. Any help would be greatly appreciated!
I've tried several different ways but I cant seem to make it work, I know some php and js, but I mostly just do front-end web design..
If it helps, my page can be viewed here..

A: $("#balance,#credit").blur(function() {
    var b = $("#balance").val();
    var c = $("#credit").val();
    if ('' == b || '' == c) {
        return;
    }
    b *= 0.0435;
    c *= 0.0025;
    b /= 12;
    c /= 12;
    var p = b + c;
    $("#payment").val(p);
});

Note that this can be written in a shorter way, but this is the easiest to understand. Also note that there is no error checking, so if someone writes "foo" in the credit box it's going to break.
A quick fiddle: http://jsfiddle.net/Q9cYv/ shows that the results match up with your Excel file.


text:
Q: typeorm) query builder, left join and delete I want to receive id and user information from the controller as arguments and delete it with query builder. But I am getting QueryFailedError: Unknown column 'certificate.id' in 'where clause' error. What's the problem?
@Entity()
@Unique(['url'])
export class CertificateEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  @IsUrl()
  url: string;

  @Column()
  valid_from: string;

  @Column()
  valid_to: string;

  @ManyToOne((type) => AuthEntity, (user) => user.certificates, {
    eager: false,
  })
  user: AuthEntity;
}

@Unique(['username'])
@Entity()
export class AuthEntity extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  email: string;

  @Column()
  username: string;

  @Column()
  password: string;

  @Column()
  signupVerifyToken: string;

  @OneToMany((type) => CertificateEntity, (certificates) => certificates.user, {
    eager: true,
  })
  certificates: CertificateEntity[];
}

// service
  async remove(id: number, user: AuthEntity): Promise<boolean> {
    console.log(id, user.id);

    // error this point !
    await this.certificateRepo
      .createQueryBuilder('certificate')
      .leftJoin('certificate.user', 'user')
      .where('certificate.id=:id', { id: id })
      .andWhere('user.id=:id', { id: user.id })
      .delete()
      .execute();
    return true;
  }

I'm not familiar with the query builder. Why Do I Get QueryFailedError: Unknown column 'certificate.id' in 'where clause' Error?

A: If it's still relevant. I never saw the solution to delete with use leftJoin.
try to use default delete(), where "id" it's "certificate.id"
this.certificateRepo.delete({ user: { id }, id: "id" });

it's just a fast example, rewrite to suit your case.
Or use 2 steps (I suggest it's a bad sulution)
const result = await this.certificateRepo
  .createQueryBuilder('certificate')
  .leftJoin('certificate.user', 'user')
  .where('certificate.id=:id', { id: id })
  .andWhere('user.id=:id', { id: user.id })
  .getMany(); // .getOne()

result.forEach((el) => this.repository.delete(el.id));

A: you need to remove the alias from the where, and the where expression needs to provide a unique parameter, otherwise the :id in andWhere will override the :id in where.
await this.certificateRepo
    .createQueryBuilder('certificate')
    .leftJoin('certificate.user', 'user')
    .where('id=:id', { id: id })
    .andWhere('user.id=:userId', { userId: user.id })
    .delete()
    .execute();


text:
Q: plpgsql operate on query before returning it I'd like to write a plpgsql procedure that executes a select query, updates the row (if existing) and then returns the result.
For that I'd like to be able to handle the procedure call like a normal query with SELECT nickname FROM use_session_token(...).
Usually I would use RETURN QUERY(...) but I want to update the row first (it's either one or none because token is a primary index)
But in fact I want the row only returned and updated if other criteria are fulfilled, so I can't just operate on the primary key itself.
I had two attempts, one using a Refcursor and the other one using SELECT INTO, but I fail to actually return a SETOF users.
My attempt with SELECT INTO:
CREATE OR REPLACE FUNCTION use_session_token(Char(128), Inet) RETURNS SETOF users AS $$
DECLARE
  row Record;
BEGIN
  SELECT u.* INTO row FROM sessions AS t
  INNER JOIN users AS u ON (t.user_id = u.id)
  WHERE
    t.token=$1 AND
    t.date_last_used > NOW() - interval '30 minutes' AND
    t.ip_address=$2 AND
    u.is_deleted=FALSE AND
    EXISTS(
      SELECT 1 FROM mail AS m
      WHERE m.user_id=u.id AND m.is_confirmed=TRUE AND m.is_deleted=FALSE
    )
  ;

  IF (row) THEN
    UPDATE sessions SET date_last_used=NOW() WHERE token=$1;
  ELSE
    -- maybe do other things if there is no result
  END IF;

  RETURN row;
END;
$$ LANGUAGE 'plpgsql';

My attempt with cursor:
CREATE OR REPLACE FUNCTION use_session_token(Char(128), Inet) RETURNS SETOF users AS $$
DECLARE
  cursor Refcursor;
  row Record;
BEGIN
  OPEN cursor SCROLL FOR (
    SELECT u.* INTO row FROM sessions AS t
    INNER JOIN users AS u ON (t.user_id = u.id)
    WHERE
      t.token=$1 AND
      t.date_last_used > NOW() - interval '30 minutes' AND
      t.ip_address=$2 AND
      u.is_deleted=FALSE AND
      EXISTS(
        SELECT 1 FROM mail AS m
        WHERE m.user_id=u.id AND m.is_confirmed=TRUE AND m.is_deleted=FALSE
    )
  );

  FETCH cursor INTO row;

  IF (FOUND) THEN
    MOVE PRIOR cursor;
    UPDATE sessions SET date_last_used=NOW() WHERE CURRENT OF cursor;
  ELSE
    -- maybe do other things if there is no result
  END IF;

  RETURN row;
END;
$$ LANGUAGE 'plpgsql';

But both attempts actually fail with the fact that I'm not really able to return a proper result set.
What would be the best way to accomplish that and to solve my problem?
And then, which of the both attempts is the better one (or is a third solution better)?

A: Your first attempt was the best (cursors tend to be slow), but you should use RETURN NEXT to return any rows from the function. With some other improvements, you get this:
CREATE OR REPLACE FUNCTION use_session_token(Char(128), Inet) RETURNS SETOF users AS $$
DECLARE
  rec users%rowtype; -- don't use reserved word as variable name, use explicit type
BEGIN
  SELECT u.* INTO rec FROM sessions AS t
  JOIN users AS u ON t.user_id = u.id
  WHERE t.token=$1
    AND t.date_last_used > now() - interval '30 minutes'
    AND t.ip_address=$2
    AND NOT u.is_deleted
    AND EXISTS (
      SELECT 1 FROM mail AS m
      WHERE m.user_id=u.id AND m.is_confirmed AND NOT m.is_deleted;

  IF FOUND THEN  -- use built-in parameter to test for result of query
    UPDATE sessions SET date_last_used = now() WHERE token=$1;
  ELSE
    -- maybe do other things if there is no result
  END IF;

  RETURN NEXT rec;
END;
$$ LANGUAGE 'plpgsql';
If you return the selected row irrespective of what happens after the SELECT query (the IF FOUND THEN ... section), then you can even forget about the rec variable and write the first statement as:
RETURN QUERY SELECT u.* ...

Note that RETURN QUERY does not actually return from the function, it merely adds data to the result set.


text:
Q: MacBook Pro suddenly started spinning fans at 100% while lid was closed for a couple of hours I've been noticing some issues with my MacBook for a while now. Firstly, kernel_task sometimes takes over extreme amounts of CPU and the whole computer starts acting slow even when I'm not using it for any heavy tasks.
Note that this is a 15" MBPro 2015, all specs maxed out.
Fans are also often at full speed for seemingly no reason (just browsing the net) but that has been going on forever since I bought it, and I heard that is relatively normal for those MBPros.
But last night the weirdest thing happened. I closed the lid and went to sleep. Several hours later in the morning, I was awoken to my MacBook fans going on at 100%.
I got up to check it out and the bottom plate was pretty hot and fans still going at 100%. I opened the lid and I couldn't get it to turn on. The screen would not show anything no matter how long I waited and how many keys I pressed.
I ended up force shutting it down (holding down the power button).
Any idea what could be causing this? Is there any way I can try to figure out the problem, or is taking it to Apple for repair the only option?

A: The first thing I'd do is a NVRAM and SMC reset (in that order). Before following the steps below, ensure you have no external hardware connected and that you're using the built-in keyboard.
Reset the NVRAM
Reset the NVRAM on your MBP as follows:

*

*Shut down your machine. Yes, a full shut down, not just logging out.

*Press the power button and then press the commandoptionpr keys. You have to make sure you press these keys before the gray screen appears or it won't work.

*Hold those keys down until your MBP reboots again and you here the startup chime.

*Let go of the keys and let your MBP reboot normally.

Note: When you log back in you may need to readjust some of your system preferences (e.g. speaker volume, screen resolution, startup disk selection, time zone information, etc).
Reset the SMC
There's a couple of ways you can reset the SMC on your MBP, however I prefer the following steps:

*

*Shut down your MBP

*Keep the power cable plugged in

*Press at the same time shiftoptioncontrol (on the left side of the keyboard) and the power button

*Let go

*Turn your computer back on with the power button

After resetting both the NVRAM and SMC, use your computer to determine if the issues still persist.
If you're still having problems, the it's time to test your hardware with Apple Diagnostics.
Run Apple Diagnostics
Follow the steps below to run Apple Diagnostics:

*

*Fully shut down your Mac

*Restart your Mac

*Immediately press the D key and keep it down until you see the Diagnostics screen appear

*Wait for Diagnostics to finish (this typically only takes a few minutes)

*Once complete, one of two things will appear on the screen:

*

*a No issues found message

*a brief description of any errors found plus further instructions

*If the diagnostics test does find errors, take a note of what they are

Note: If pressing and holding the D key at Step 3 doesn't work, start again at Step 1 and, at Step 3 press and hold both the OptionD keys instead. This will try and run diagnostics from the internet instead, so you will need to allow more time for it to complete.
Regardless, take a note of what happens and let me know how you went.

A: It happened to me, it's just a final step of the update install completion process.


text:
Q: React router in TypeScript- both router and own props my component has some own props
class Props {
  wizard: WizardConfig;
}

and I want to access router history so I also pass router props
type PropsType = Props & RouteComponentProps<{}>;

class Wizard extends React.Component<PropsType> {}

The problem is that in component's usage
 <Wizard wizard={someWizar} />

I get errors that RouteComponentProps props are not passed so for example:
   Property 'match' is missing in type '{ wizard: WizardConfig; }'
I tried to do:
export default withRouter(Wizard);

but it didn't help.

A: Fixed by changing
export default withRouter(Wizard);

to
export default withRouter<PropsType>(Wizard);


text:
Q: Compiling a file and adding to a "library path" First, I am new to Linux and Ubuntu.
I obtained the following directions from a CFD website:

"Hey Alex,
I just had the same problem as you did, but a friend of mine found a
  fix. It is likely that salome forgot to update a dependency in the new
  version (8.4.0), libjasper.so.1 in fact. You can download it from:
  http://ece.uvic.ca/~frodo/jasper/#download , where you should download
  jasPer 1.900.22 (the later ones have a different system). If you then
  compile it and add the generated libjasper.so.1 to the path it works
  like a charm ;)
hopefully this is enough to fix the problem, but it would be better if
  salome added the dependency in the next update or so. Good luck!"

I am having the same problem and would like detailed instructions on how to implement the above suggestion. I have never complied on Linux, Ubuntu, etc.
In addition to compiling, I have to add to a "library" and that is not explained in other tutorials.

A: Look in the "docs" directory, there's a file called "jasper.pdf". In serction 2.4.1 there are instructions for building and installing on Linux:
$ ./configure
$ make
$ sudo make install

The last command (sudo make install) should copy the libjasper.so to the appropriate directory. If it doesn't, just manually copy it to /usr/lib:
$ sudo cp `find ./ -name 'libjasper.so'` /usr/lib/

BTW: You're probably better off asking such questions (about building software) in StackOverflow.


text:
Q: If I LabelEncode categorical data, do I still need to use categorical_feature when creating a LightGBM dataset? I am trying to create a simple model in lightgbm using two features, one is categorical and the other is a distance. I am following a tutorial (https://sefiks.com/2018/10/13/a-gentle-introduction-to-lightgbm-for-applied-machine-learning/) which states that even after LabelEncoding, I still need to tell lightgbm that my encoded feature is categorical in nature. However, I get these series of warning message when I try to do so:
UserWarning: Using categorical_feature in Dataset.
  warnings.warn('Using categorical_feature in Dataset.')
UserWarning: categorical_feature in Dataset is overridden.
New categorical_feature is ['type']
 'New categorical_feature is
    {}'.format(sorted(list(categorical_feature))))
 categorical_feature in param dict is overridden.
  warnings.warn('categorical_feature in param dict is overridden.')

What I'm wondering is whether lightgbm does in fact understand the column is categorical in nature. It seems like it does but I'm not sure why the tutorial explicitly states it doesn't. Below is the code I have:
trainDataProc = pd.read_csv('trainDataPrepared.csv', header=0)

le=prep.LabelEncoder()

num_columns=trainDataProc.shape[1]

for i in range(0, num_columns):
    column_name=trainDataProc.columns[i]
    column_type=trainDataProc[column_name].dtypes
    if column_type == 'object':
        le.fit(trainDataProc[column_name])
        encoded_feature=le.transform(trainDataProc[column_name])
        trainDataProc[column_name]=pd.DataFrame(encoded_feature)

# Prepare train X and Y column names.
trainColumnsX = ['type', 'dist']
cat_feat=['type']
trainColumnsY = ['scalar']

# Perform K-fold split.
kfold = mls.KFold(n_splits=5, shuffle=True, random_state=0)
result = next(kfold.split(trainDataProc), None)
train = trainDataProc.iloc[result[0]]
test = trainDataProc.iloc[result[1]]

# Train model via lightGBM.
lgbTrain = lgb.Dataset(train[trainColumnsX], label=train[trainColumnsY],
                       categorical_feature=cat_feat)
lgbEval = lgb.Dataset(test[trainColumnsX], label=test[trainColumnsY])

# Model parameters.
params = {
    'boosting_type': 'gbdt',
    'objective': 'regression',
    'metric': {'mae'},
    'num_leaves': 25,
    'learning_rate': 0.0001,
    'feature_fraction': 0.9,
    'bagging_fraction': 0.8,
    'bagging_freq': 5,
    'verbose': 0
}

# Set up training.
gbm = lgb.train(params,
                lgbTrain,
                num_boost_round=200,
                valid_sets=lgbEval,
                early_stopping_rounds=50)

A: I was also facing similar warning message and looked at scikit-learn documentation.
Its not required to define separately if you are using pandas Dataframe with categorical features(and label encoded as integers).
Default value of parameter 'categorical_feature' for LGBM is 'Auto', which ensures that pandas categorical columns are automatically used.

A: The reason why you should still tell LightGBM that the features that you encode are categorical is because the model sees a numerical variable so it will try to split the variable using bigger or smaller than a threshold that is not correct if we are talking about a categorical variable.

A: Even if you do Label Encoding, all it does is it labels the values in some order. But that column will still contain numbers which is why LightGBM will try to split on that variable like it's a continuous feature.
So we need to provide that column name explicitly so that LightGBM knows that it needs to treat that variable differently.


text:
Q: Probability of 2 phones returning exactly same GPS co-ordinates, using Network_Provider on Android What is the probability of 2 different android devices returning exactly the same GPS co-ordinates. According to the wiki, the 5th decimal place gives a accuracy of 1.1m, and the onLocationChanged returns upto 7 decimal points, meaning accuracy of 1cm. Now we also have to account for the fact that GPS technology itself will introduce some errors. From what I understand (and from my tests), phone kept at the same location is returning between 0.18143341 meters to 22 meters.
I need to know this to arrive at a realistic algorithm to identify people by their location. The question is, do I need to associate the identity of the person too in the mix of my equation or can I safely assume that 2 phones in the exactly same location will not return the exact same GPS (ever).
Thoughts anyone ?
Samples below (30 second apart)
02-21 14:18:48.679: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:19:18.678: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:19:48.668: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 14:20:18.797: D/Taxeeta:RegularUpdates(5511): Is location changed 6.563945
02-21 14:20:48.676: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:21:18.725: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:21:48.685: D/Taxeeta:RegularUpdates(5511): Is location changed 2.6022007
02-21 14:22:18.704: D/Taxeeta:RegularUpdates(5511): Is location changed 6.5060697
02-21 14:22:48.703: D/Taxeeta:RegularUpdates(5511): Is location changed 6.572767
02-21 14:23:18.662: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:23:48.772: D/Taxeeta:RegularUpdates(5511): Is location changed 6.563945
02-21 14:24:18.681: D/Taxeeta:RegularUpdates(5511): Is location changed 0.1327054
02-21 14:24:48.720: D/Taxeeta:RegularUpdates(5511): Is location changed 7.176328
02-21 14:25:18.700: D/Taxeeta:RegularUpdates(5511): Is location changed 7.6471653
02-21 14:25:48.609: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:26:18.708: D/Taxeeta:RegularUpdates(5511): Is location changed 7.790146
02-21 14:26:48.717: D/Taxeeta:RegularUpdates(5511): Is location changed 14.501556
02-21 14:27:18.797: D/Taxeeta:RegularUpdates(5511): Is location changed 0.1327054
02-21 14:27:48.676: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:28:18.705: D/Taxeeta:RegularUpdates(5511): Is location changed 0.19548245
02-21 14:28:48.704: D/Taxeeta:RegularUpdates(5511): Is location changed 23.221346
02-21 14:29:18.684: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:29:48.723: D/Taxeeta:RegularUpdates(5511): Is location changed 7.176328
02-21 14:30:18.662: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:30:48.752: D/Taxeeta:RegularUpdates(5511): Is location changed 6.3350186
02-21 14:31:18.691: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:31:48.670: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:32:18.679: D/Taxeeta:RegularUpdates(5511): Is location changed 0.1327054
02-21 14:32:48.699: D/Taxeeta:RegularUpdates(5511): Is location changed 7.411349
02-21 14:33:18.708: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:33:48.697: D/Taxeeta:RegularUpdates(5511): Is location changed 22.613928
02-21 14:34:18.666: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:34:48.686: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 14:35:18.675: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:35:48.664: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:36:18.663: D/Taxeeta:RegularUpdates(5511): Is location changed 0.19548245
02-21 14:36:48.693: D/Taxeeta:RegularUpdates(5511): Is location changed 22.190514
02-21 14:37:18.782: D/Taxeeta:RegularUpdates(5511): Is location changed 7.2989116
02-21 14:37:48.701: D/Taxeeta:RegularUpdates(5511): Is location changed 20.302017
02-21 14:38:18.721: D/Taxeeta:RegularUpdates(5511): Is location changed 22.503975
02-21 14:38:48.670: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:39:18.699: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 14:39:48.648: D/Taxeeta:RegularUpdates(5511): Is location changed 0.0
02-21 14:40:18.668: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:40:48.787: D/Taxeeta:RegularUpdates(5511): Is location changed 0.1327054
02-21 14:41:18.876: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 14:41:48.705: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18583706
02-21 14:42:18.705: D/Taxeeta:RegularUpdates(5511): Is location changed 7.411349
02-21 14:42:48.664: D/Taxeeta:RegularUpdates(5511): Is location changed 0.0
02-21 14:43:18.703: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 14:43:48.692: D/Taxeeta:RegularUpdates(5511): Is location changed 15.474865
02-21 14:44:18.772: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:44:48.671: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:45:18.700: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:45:48.700: D/Taxeeta:RegularUpdates(5511): Is location changed 7.176328
02-21 14:46:18.699: D/Taxeeta:RegularUpdates(5511): Is location changed 22.503975
02-21 14:46:48.738: D/Taxeeta:RegularUpdates(5511): Is location changed 7.176328
02-21 14:47:18.677: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:47:48.677: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:48:18.676: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:48:48.885: D/Taxeeta:RegularUpdates(5511): Is location changed 0.19548245
02-21 14:49:18.674: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:49:48.694: D/Taxeeta:RegularUpdates(5511): Is location changed 6.524145
02-21 14:50:18.763: D/Taxeeta:RegularUpdates(5511): Is location changed 0.1327054
02-21 14:50:48.702: D/Taxeeta:RegularUpdates(5511): Is location changed 6.4802594
02-21 14:51:18.712: D/Taxeeta:RegularUpdates(5511): Is location changed 6.4802594
02-21 14:51:48.671: D/Taxeeta:RegularUpdates(5511): Is location changed 0.19548245
02-21 14:52:18.690: D/Taxeeta:RegularUpdates(5511): Is location changed 7.790146
02-21 14:52:48.689: D/Taxeeta:RegularUpdates(5511): Is location changed 4.656421
02-21 14:53:18.689: D/Taxeeta:RegularUpdates(5511): Is location changed 6.563945
02-21 14:53:48.768: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:54:18.667: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 14:54:48.726: D/Taxeeta:RegularUpdates(5511): Is location changed 6.524145
02-21 14:55:18.696: D/Taxeeta:RegularUpdates(5511): Is location changed 6.7189484
02-21 14:55:48.685: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 14:56:18.854: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:56:48.713: D/Taxeeta:RegularUpdates(5511): Is location changed 6.4802594
02-21 14:57:18.813: D/Taxeeta:RegularUpdates(5511): Is location changed 6.6248784
02-21 14:57:48.692: D/Taxeeta:RegularUpdates(5511): Is location changed 7.176328
02-21 14:58:18.731: D/Taxeeta:RegularUpdates(5511): Is location changed 6.524145
02-21 14:58:48.691: D/Taxeeta:RegularUpdates(5511): Is location changed 0.13724314
02-21 14:59:18.670: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 14:59:48.749: D/Taxeeta:RegularUpdates(5511): Is location changed 7.176328
02-21 15:00:18.688: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 15:00:48.748: D/Taxeeta:RegularUpdates(5511): Is location changed 0.22683989
02-21 15:01:18.797: D/Taxeeta:RegularUpdates(5511): Is location changed 0.22683989
02-21 15:01:48.716: D/Taxeeta:RegularUpdates(5511): Is location changed 21.353783
02-21 15:02:18.745: D/Taxeeta:RegularUpdates(5511): Is location changed 0.1327054
02-21 15:02:48.695: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 15:03:18.684: D/Taxeeta:RegularUpdates(5511): Is location changed 0.1327054
02-21 15:03:48.723: D/Taxeeta:RegularUpdates(5511): Is location changed 6.0702796
02-21 15:04:18.783: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 15:04:48.682: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 15:05:18.671: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124
02-21 15:05:48.780: D/Taxeeta:RegularUpdates(5511): Is location changed 0.1327054
02-21 15:06:18.710: D/Taxeeta:RegularUpdates(5511): Is location changed 4.9840126
02-21 15:06:48.689: D/Taxeeta:RegularUpdates(5511): Is location changed 0.201804
02-21 15:07:18.728: D/Taxeeta:RegularUpdates(5511): Is location changed 0.18143341
02-21 15:07:48.687: D/Taxeeta:RegularUpdates(5511): Is location changed 0.11805124

A: GPS sensitivity and accuracy are two different things. Sensitivity which also should be accounted here. GPS using hardware tends to malfunction (after long run and varying temprature) and the accuracy can be lost upto 20meters (like you said). In general GPS has its own accuracy of upto 5 meters (in general).
My recent experience with an app that tracks users through GPS made me decide that:
You definitely need an identity to separate two devices
As they can return same co-ordinates.

A: I believe you would almost certainly be better off by pairing some unique device id + coordinates. Because the coordinates you get in the phone can be a calculation based on WLAN and cell towers and not only a GPS signal(for example when the user is indoors) and then you get a higher chance of having the same coordinates.
Also consider the possibility of malicious users who can fake their location with some utilities, could that be used to compromise your users accounts and/or specific use cases?

A: You are confusing accuracy and precision.
Centimeter-level accuracy is really only available in professional surveying GPS units, and that is usually after post processing the data.  Even semi-expensive commercial models generally are only accurate within 10-20m, although they can be accurate down to 1m, but that depends on a lot of external factors such as the GDOP and what obstructions are around you.  I have not done any analysis to verify, but a phone GPS would typically fall within the the same level of accuracy.
The onLocationChanged method may have 7 decimal places of precision but it doesn't make any more accurate, it just means they are providing you with 7 decimal places.  The same semi-expensive commercial handheld GPS models I reference above usually only have 5 decimal places of precision, but it doesn't change the accuracy of the result.
That being said, I have spent a significant amount of time reviewing GPS records done in field surveys over the last few years and what I have found is that while it is improbable that the same GPS is going to return the exact same coordinates multiple times in short succession, it does happen.  Likewise, when you consider you are dealing with multiple devices and an unknown period of time, it is highly likely you will have multiple devices that return the same exact coordinates.
You should always include an identity to identify a specific device and not rely on GPS coordinates alone to identify a specific user or device.

A: I have many years of experience in GPS app development, what I saw is that it is unlikely that two different devices will ever send the exactly same GPS position (related to 7 digits). But it can happen. I have not made this specific evaluation (but a simular one), but my feeling is that this happens not more than 1 time in some ten thousand cases.
You probably  can live with that minimal chance that this will happen.
Many people would have to buy the app that this ever can happen.;-)
You can also compare two following positions, instead of one. (You can combine these two in one long value)
But the argument that positions also could have been calxulated by cell tower location, is to to be considered. in my app i ignore cell tower locations, i only use GPS.


text:
Q: How to customize webhook port in openshift 4.5 Creating a buildconfig and running oc set triggers bc <my_app> --from-github creates a webhook for me. However the port is on a non standard one. This causes issues for us since our internal github instance can only connect to e.g. 443 because of a company firewall.
So this leads me to the question, where is this configured? How can I decide which port to use?


text:
Q: How to change default shutdown option in Classic Shell? Since last Windows update my computer shows the Classic Shell shutdown menu in a different order.

And the "Shut down" option is not the default option. How can I modify it?
In the picture above you can see the Classic Start Menu.
Below you can see Windows 10 menu.
But the problem is not related with the menu but with the fact that when I select shutdown the default option is not "shutdown" anymore as it was some months ago.

A: *

*Go to Classic Start Menu Settings.

*Select Show all settings.

*On the Customize Start Menu tab, you can drag-and-drop items to change the order or to make submenus.

BTW, you can add additional items. Above, you can see Awake 10 hrs, a shortcut to a Do Not Sleep configuration, and Shutdown (full, no hiberfil.sys), which is useful when dual booting, to allow access to the Windows partition.
Let's hope developers keep this vital tool from Ivo Beltchev functional as Windows evolves!

A: I just stumbled upon this question while searching for the very same thing, and seeing that it has no accepted answer:
Just search for "shutdown" in the Classic Shell settings. There you should be able to select any shutdown option as your default action.
Or find it in the "Main Menu" section of the settings.


text:
Q: children not staying inside parent divs Fiddle: https://jsfiddle.net/uatzust3/
Here is the fiddle for my problem, you'll observe that the children are not staying inside the parent div card and also I want the divs to take full width of parent which they are not taking.
Also, where should I be learning best practices? I am new to the community. Thanks in advance.
The left div(black_container) is short of content but should arrange the height according to the width of the right div(content_container) all the while staying inside the card div.

.card {
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.30), 0 15px 15px rgba(0, 0, 0, 0.22);
  max-width: 800px;
  margin: auto;
  position: relative;
}
.black_container {
  height: inherit;
  background: #333;
  display: inline-block;
  vertical-align: top;
  padding: 3%;
  font-family: 'Nunito', sans-serif;
}
.content_container {
  display: inline-block;
  padding: 3%;
  /* position: absolute;
    top:0;
    bottom: 0; */
}
.small_bar {
  padding: 3px;
  width: 30px;
  margin: 0 auto;
  background: #e4e4e4;
  margin-top: 35px;
}
.name {
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 5px;
  margin: 30px auto 5px auto;
  text-align: center;
  font-weight: 800;
}
.designation {
  font-size: 10px;
  margin: 0 auto;
}
.qrcode_container {
  float: right;
}
.qr_container {
  overflow: auto;
  width: 100%;
}
.qr_text {
  display: inline-block;
  list-style-type: none;
}
.qr_text>li {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2.5px;
  color: #9a9a9a;
}
.bars {
  display: inline-block;
  position: relative;
  top: 10px;
}
.bars .small_bar {
  width: 15px;
  background: #777;
}
.bar {
  position: absolute;
  top: -80px;
}
.qr_code {
  display: inline-block;
  height: inherit;
  border: 1px solid #e4e4e4;
  padding: 5px;
}
.button {
  width: 150px;
  letter-spacing: 1;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
  text-align: center;
  background: #333;
  padding: 5px 10px;
}

wow

Front-End Designer

LOREM

IPSUM

DPOLER

Hello!

My name is lorem

I am a web designer

Im stuck

button

A: A parent cannot take the height of a direct child if the child is absolute because the absolute elements are removed from the document flow(like floats), so in this case "card" doesn't even know "content_container" even exists .
https://jsfiddle.net/OmarIsComing/eq4L86g9/1/
update:
solution with flexbox: https://jsfiddle.net/OmarIsComing/eq4L86g9/2/
solution without flexbox: https://jsfiddle.net/OmarIsComing/eq4L86g9/3/

A: If flexbox is an option, this is easy :

*

*Add display: flex to your card

*Add flex: 1 to the content-container
See demo below:

.card {
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.30), 0 15px 15px rgba(0, 0, 0, 0.22);
  max-width: 800px;
  margin: auto;
  position: relative;
  display: flex;
}
.black_container {
  height: inherit;
  background: #333;
  display: inline-block;
  vertical-align: top;
  padding: 3%;
  font-family: 'Nunito', sans-serif;
}
.content_container {
  display: inline-block;
  padding: 3%;
  /* position: absolute;
    top:0;
    bottom: 0; */
  flex: 1;
}
.small_bar {
  padding: 3px;
  width: 30px;
  margin: 0 auto;
  background: #e4e4e4;
  margin-top: 35px;
}
.name {
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 5px;
  margin: 30px auto 5px auto;
  text-align: center;
  font-weight: 800;
}
.designation {
  font-size: 10px;
  margin: 0 auto;
}
.qrcode_container {
  float: right;
}
.qr_container {
  overflow: auto;
  width: 100%;
}
.qr_text {
  display: inline-block;
  list-style-type: none;
}
.qr_text>li {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2.5px;
  color: #9a9a9a;
}
.bars {
  display: inline-block;
  position: relative;
  top: 10px;
}
.bars .small_bar {
  width: 15px;
  background: #777;
}
.bar {
  position: absolute;
  top: -80px;
}
.qr_code {
  display: inline-block;
  height: inherit;
  border: 1px solid #e4e4e4;
  padding: 5px;
}
.button {
  width: 150px;
  letter-spacing: 1;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
  text-align: center;
  background: #333;
  padding: 5px 10px;
}

wow

Front-End Designer

LOREM

IPSUM

DPOLER

Hello!

My name is lorem

I am a web designer

Im stuck

button

A: Use the class card-body, this will keep the contents inside of the card.

Card Title

                Stuff

                Stuff Details

A: replace the .content_container css with:
.content_container {
    display: inline-block;
    padding: 3%;
    vertical-align: top;
}

I think the CSS attribute position: absolute; is causing this issue. In short, absolute position removes the element from the flow of other elements; therefore, its height is simply ignored, and never counted in your .card container.


text:
Q: How to get image source attribute inside a directive? I have a simple image directive like this:
(function () {
    'use strict';
    angular
        .module('myapp')
        .directive('imageTest', imageTest);
    function imageTest() {
        var directive = {
            'link': link,
            'restrict': 'A',
            'scope': {}
        };

        return directive;
    }

    function link($scope, element) {
        var src = element.src;
        console.log(src) => undefined
        // code to modify src
    }

})();

html
<img id="image" ng-src="{{myImg.url}}" image-test/>

All i need is to get image src attribute inside the directive but I can't seem to find out how to do it. Can anyone help me about it? Thanks a lot!

A: In the attribute there is an expression, which will evaluate after instantiation of the directive. You can use $observe to get the value:
function link($scope, element, attrs) {
    attrs.$observe('ngSrc', function(url) {
        console.log(url);
    });
}


text:
Q: VSTO add-in event handler In Shared add-in the following event handler code for add-in start up is as follows:
Public Sub OnStartupComplete(ByRef custom As System.Array) _
 Implements Extensibility.IDTExtensibility2.OnStartupComplete
End Sub

In VSTO it was replace with
Private Sub ThisAddIn_Startup() Handles Me.Startup
End Sub

Is there anyway to create event handler equivalent for VSTO without using extensibility
Public Sub OnAddInsUpdate(ByRef custom As System.Array) _
 Implements Extensibility.IDTExtensibility2.OnAddInsUpdate
End Sub

Thanks.

A: VSTO wraps the IExtensibility2 interface completely and it doesn't expose that AddinsUpdate callback (not publicly, but I believe it DOES intercept it internally).
You might compile, then run reflector to reverse engineer the VSTO code that implements IExtensibility. I did that at one point to figure out how to hook into the "GetUI" Extensibility callback so I could push out custom Backstage XML from a VSTO 2008 addin (Backstage view isn't directly supported by Vsto2008).
But I didn't notice/look for the AddinsUpdate call back.


text:
Q: Video Player Crashes pathForResource Swift iOS Currently i try to setup a small app that simply play a video (just for my daughter) but it always crashes on the "path"
import UIKit
import MediaPlayer

var moviePlayer : MPMoviePlayerController?

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        playVideo()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func playVideo() {

        let path = NSBundle.mainBundle().pathForResource("video", ofType:"mp4")
        let url = NSURL.fileURLWithPath(path!)
        moviePlayer = MPMoviePlayerController(contentURL: url)
        if let player = moviePlayer {
            player.view.frame = self.view.bounds
            player.prepareToPlay()
            player.scalingMode = .AspectFill
            self.view.addSubview(player.view)
        }
    }

}

The crash happens here  let path = NSBundle.mainBundle().pathForResource("video", ofType:"mp4")

fatal error: unexpectedly found nil while unwrapping an Optional value
  cause path is empty

A: You have to add the video in your Xcode target under Build Phases to the Copy Bundle Resources.

A: The NSBundle pathForResource function crashes if it can't locate the file in the bundle. To fix this, you can do something like:
let bundlePath:String = NSBundle.mainBundle().resourcePath!
let filePath:String = "\(bundlePath)/video.mp4"

A: Make sure the video asset file has the 'Target Membership' checkbox checked. Select the asset in the left hand panel 'Project navigator', then in the right hand panel under 'Target Membership' make sure the checkbox is checked next to the project scheme name.


text:
Q: Django view doesn't properly redirect When view function - index is called with post request it doesn't redirect. Print inside the function executes. Can't find reason. I changed return redirect('/result') to return HttpResponse("some text") and it does not work either. I use Django 1.9.5.
My code:
data = {"number" : 0}

@csrf_exempt
def result(request):
    global data
    response = "solution: " + str(data['number'])
    return HttpResponse(response)

@csrf_exempt
def index(request):
    global data
    if request.method == 'POST':
        uploadFile1 = request.FILES['file1']
        uploadFile2 = request.FILES['file2']
        text1 = ''
        text2 = ''
        with open('file1', 'wb+') as file1:
            text1 = uploadFile1.read()
        with open('file1', 'wb+') as file2:
            text2 = uploadFile2.read()
        data = calcpy.views.getNumber(str(text1), str(text2))
        print('test') #this executes
        return redirect("/result")

    template = loader.get_template('main.html')
    context = {'solution' : 0}
    return HttpResponse(template.render(context))

My urls.py code:
from django.conf.urls import patterns, include, url

from . import views
import version.models

web_srv_prefix = version.models.getWebSrvPrefix()

urlpatterns = patterns('',
                       url(r'^' + web_srv_prefix + '/ajax/(?P<module>\w+)/(?P<function>\w+)/', views.ajax, name='ajax'),
                       url(r'^$', views.index, name='index'),
               url(r'^result/$', views.result, name='result')

)

A: redirect accepts a url name not a path, use this:
return redirect('result')


text:
Q: How to combine SELECT SQL subquerys with RAND? Hi I'm trying to combine some querys in to one, but I'm unsure how to solve this. I know there are millions of other examples but I can't figure out how to translate them into my query.
This is the database. First is table name:, then Primary Key and Foreign key
gallery:
    galleryID
    name
    addedDate

concert:
    concertID
    galleryID
    name
    URL
    addedDate

photo:
    photoID
    concertID
    name

Here is my query which is returning NULL on URL on random occasions. I guess this is because concertID and URL should be selected at the same time. But it's not allowed to have SELECT concertID, URL FROM concert WHERE galleryID = g.galleryID ORDER BY RAND() LIMIT 1 So how do I solve this?
What I'm selecting in this 1st query is correct except from getting NULL on URL. So what I need to select is galleryID AND addedDate FROM gallery (1 galleryID per row NOT 8 of the same), concertID AND URL FROM concert (1 random post with same concertID), name FROM photo (1 random post with same concertID). Giving me these results:
11  2012-07-31 15:44:35 90  Picture\Path11  SomePicture28.jpg
36  2012-07-31 14:31:36 208 Picture\Path36  SomePicture11.jpg
09  2012-07-30 15:28:02 33  Picture\Path09  SomePicture69.jpg

SELECT galleryID, addedDate,
    (SELECT concertID
        FROM concert
            WHERE galleryID = g.galleryID
    ORDER BY RAND() LIMIT 1) AS curID,
    (SELECT URL
        FROM concert
            WHERE concertID = curID) AS URL,
    (SELECT p.name
            FROM photo p, concert c
                WHERE p.concertID = curID AND c.galleryID = g.galleryID
     ORDER BY RAND() LIMIT 1) AS photoName
FROM gallery g ORDER BY addedDate DESC LIMIT 8;

I have also tried to do this with a JOIN with this error #1054 - Unknown column 'p.concertID' in 'where clause'
SELECT galleryID, addedDate, c.concertID, c.URL, p.name
    FROM (SELECT concertID, URL,
            (SELECT name
                FROM photo
                    WHERE p.concertID = curID.concertID
             ORDER BY RAND() LIMIT 1) AS photoName
             FROM concert
                WHERE c.galleryID = curID.galleryID
          ORDER BY RAND() LIMIT 1) curID
LEFT JOIN concert c ON curID.galleryID = c.galleryID
LEFT JOIN photo p ON p.name = curID.photoName
ORDER BY addedDate DESC LIMIT 8;

A: In your query, you have a correlated subquery in the "FROM" clause.  And things are getting more confusing from there.
It looks like you are trying to get one photo associated with the concert (which is in a gallery).  You can do this by moving the correlated subquery to the "SELECT" clause:
SELECT galleryID, addedDate, c.concertID, c.URL,
       (select name
        from photo p
        where p.concertID = c.concertId
        order by rand()
        limit 1
       ) photoname
FROM concert c left join
      gallery g
      ON g.galleryID = c.galleryID
ORDER BY addedDate DESC
LIMIT 8;

To get 8 photos from 8 different galleries, try the following:
SELECT galleryID, addedDate, c.concertID, c.URL,
       (select name
        from photo p
        where p.concertID = c.concertId
        order by rand()
        limit 1
       ) photoname
FROM (select g.*
      from gallery g
      order by rand()
      limit 8
     ) g join
     concert c
     ON g.galleryID = c.galleryID
where c.concert_id =
          (select csub.concert_id
           from concert csub
           where csub.galleryID = g.galleryID
           order by rand()
           limit 1
          )
ORDER BY addedDate DESC

A: I couldn't see any reason in your SQL why you be getting null for the URL, do they all have a value.
I have redone your query in another format, it is similar to what you already do
SELECT R.*, c.URL, (SELECT p.Name FROM Photo p WHERE p.ConcertID = R.CurID ORDER BY RAND() LIMIT 1) AS PhotoName
FROM
(SELECT GalleryID, AddedDate,(SELECT ConcertID FROM Concert c WHERE c.GalleryID = g.GalleryID ORDER BY RAND() LIMIT 1) AS CurID
FROM Gallery g
ORDER BY AddedDate DESC LIMIT 8) AS R
JOIN Concert c ON R.CurID = c.ConcertID


text:
Q: Unable to validate RS256 signed JWT I am trying to implement signed JWT (RS256) on a dotnet webapi along with KeyCloak. On app start I can see the openid calls being made to keycloak with the expected response content (requests shown below).
Get the jwks_url here
GET https://localhost:8080/auth/realms/core/.well-known/openid-configuration

Get the keys from here
GET https://localhost:8080/auth/realms/core/protocol/openid-connect/certs

I then get an access_token with the request below
POST https://localhost:8080/auth/realms/core/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded

grant_type=password&client_id=admin-cli&username=jim&password=foobar

I then test out the following endpoint
[ApiController]
[Route("/")]
public class AppController : ControllerBase
{
    [Authorize]
    [HttpGet]
    public OkObjectResult Get()
    {
        return Ok("This is the secured page");
    }
}

with this request
GET https://localhost:5001
Authorization: Bearer MY_TOKEN

But I always get a 401
HTTP/1.1 401 Unauthorized
Content-Length: 0
Date: Wed, 18 Nov 2020 17:41:28 GMT
Server: Kestrel
Www-Authenticate: Bearer error="invalid_token", error_description="The signature key was not found"

The signature key (third 'chunk') does exist in the token. Below is the JWT validation code. Am I missing something?
public void ConfigureServices(IServiceCollection services)
{
    services.AddControllers();

    var audience = Configuration["Jwt:Audience"];
    var issuer = Configuration["Jwt:Issuer"];
    bool.TryParse(Configuration["Jwt:RequireHttpsMetadata"], out var requireHttpsMetadata);

    IConfigurationManager<OpenIdConnectConfiguration> configurationManager =
        new ConfigurationManager<OpenIdConnectConfiguration>(
            $"{Configuration["Jwt:Authority"]}/auth/realms/core/.well-known/openid-configuration",
            new OpenIdConnectConfigurationRetriever());
    var openIdConfig =
        configurationManager.GetConfigurationAsync(CancellationToken.None).Result;

    services.AddAuthentication(options =>
        {
            options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
            options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
            options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
        })
        .AddJwtBearer(options =>
        {
            options.SaveToken = true;
            options.RequireHttpsMetadata = requireHttpsMetadata;
            options.TokenValidationParameters.IssuerSigningKeys = openIdConfig.SigningKeys;
            options.TokenValidationParameters = new TokenValidationParameters
            {
                ValidateIssuer = true,
                ValidateAudience = true,
                ValidateLifetime = true,

                ValidIssuer = issuer,
                ValidAudience = audience,
                ValidateIssuerSigningKey = true,
            };
        });
}

A: Since the JWT holds a signature (aka third chunk) I would interpret the message
"The signature key was not found"

that there is a problem with the validation of the signature.
Recheck the responses/accessibility of
GET https://localhost:8080/auth/realms/core/protocol/openid-connect/certs


text:
Q: Resize of math symbols in Tikz I want to increase the size of the inside circle. Also need to increase box.
How to do these in tikz?
\node [scale=1.125,draw,inner sep=4pt,fill=red!500] at (14.0,-2) {$\mathlarger{\boxplus}$};

A: Take your pick.
\documentclass{article}
\usepackage{amssymb}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node [scale=1.125,draw,inner sep=4pt,fill=red!50] at (0,0) {\large$\boxplus$};
\node [scale=1.125,draw,inner sep=4pt,fill=red!50] at (0,-1) {\Large$\boxplus$};
\node [scale=1.125,draw,inner sep=4pt,fill=red!50] at (0,-2) {\LARGE$\boxplus$};
\node [scale=1.125,draw,inner sep=4pt,fill=red!50] at (0,-3) {\huge$\boxplus$};
\node [scale=1.125,draw,inner sep=4pt,fill=red!50] at (0,-4) {\Huge$\boxplus$};
\end{tikzpicture}

\end{document}

Note that red!500 is the same as red, because the number following ! is a percentage, so using a number larger than 100 is useless (you can't get "redder than red").


text:
Q: Открыть .pyc файл с помощью C# У меня есть проект на C#, но некоторые его части написанны python 3.5. Я хочу, чтобы при запуске моего C# проекта, автоматически запускался и моя python  программа. С помощью pyinstaller, я превратил свой .py файл в .pyc. Вот способы которыми я способал открыть файл с помощью C#:
static void Main(string[] args)
{
    //Я знаю, что File.Open() открывает FileStream для чтения и записи. Попробовал это от безысходности
    File.Open(filepath, FileMode.Open);

    Console.ReadLine();
}

Этот вариант просто не сработал, запускалась пустая консоль и ничего не происходило (я точно уверен что .pyc не запустился, ибо он должен был написать Hello World! в определённый текстовый файл, чего он не сделал)

static void Main(string[] args)
{
    Process prc = new Process();
    prc.StartInfo = new ProcessStartInfo();
    prc.StartInfo.FileName = filepath;
    prc.StartInfo.WorkingDirectory = Path.GetDirectoryName(filepath);
    prc.StartInfo.UseShellExecute = false;
    prc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;

    prc.Start();
}

Этот вариант выдал Win32Exception с информацией:

Указанный исполняемый файл не является действительным

P.S При преобразовании из .py в .pyc, pyinstalller также создал .exe файл с именем моего python скрипта, но он (в отличие от файлов .py и .pyc), выдает Error (аналог Exception на python) сразу при запуске (даже если запуск из среды)

UPD: Попробовал сделать .pyc файл аргументом к .exe файлу, получился такой код:
static void Main(string[] args)
{
    Console.WriteLine("Attempting to start process 'File_Bot.exe'...");

    Process prc = new Process();
    prc.StartInfo = new ProcessStartInfo();
    prc.StartInfo.FileName = exePath;
    prc.StartInfo.WorkingDirectory = Path.GetDirectoryName(exePath);
    prc.StartInfo.Arguments = pycPath;
    prc.StartInfo.UseShellExecute = false;
    prc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;

    prc.Start();
    Console.WriteLine("Process {0}.exe started!", prc.ProcessName);

    Console.ReadLine();
}

Оба сообщения на консоль выводятся, но процесс не делает то, что должен (хотя .py файл на котором он основам делает). Процесс даже не появляется в диспетчере задач...
Также попробовал запустить .exe из консоли, выдал Stack Trace который не выдается при запуске .py файла


text:
Q: Using stat() and wordexp() to display executable and hidden files in C I am fairly new to Linux C Programming and need a little help displaying executable and hidden files using the stat and wordexp functions. ANy help is appreciated. Here is what i have so far:
int main(int argc, char **argv)
{

    char fileName[60];

    char *pos;

    wordexp_t p;

    char **w;

    int i;

    struct stat st;

    fprintf(stdout,"Enter file name: ");
    fgets(fileName,sizeof(fileName),stdin);

    if((pos=rindex(fileName,'\n'))==(fileName+strlen(fileName)-1))
        *pos='\0';

    wordexp(fileName,&p,0);
    w = p.we_wordv;

    for(i = 0; i < p.we_wordc; i++)
    {
        printf("%s\n",w[i]);
        wordfree(&p);
    }

    return 0;
}

A: On Linux, hidden file begins with dot, so you need to check first character of filename.
Executable files can be filtered by checking file mode (you can read more about it here - look for st_mode field of this structure).
Below simple application, which lists all hidden or executable files in current directory:
#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>

int main(void)
{
  DIR           *d;
  struct dirent *dir;
  struct stat buf;
  d = opendir(".");
  if (d)
    {
      while ((dir = readdir(d)) != NULL)
    {
      stat(dir->d_name, &buf);
      if ((strlen(dir->d_name) > && dir->d_name[0] == '.') || (buf.st_mode & S_IXGRP || buf.st_mode & S_IXUSR || buf.st_mode & S_IXOTH)
        printf("%s\n", dir->d_name);
    }

      closedir(d);
    }

  return(0);
}

You should also remember about two things:

*

*directories usually have executable permissions

*there are two special directories in linux: '.' and '..'
But I don't know whether you're going to filter it or not.


text:
Q: A data source instance has not been supplied for the data source I'm currently trying to dynamically send an rdl report to my ReportViewer .net object.
I keep getting the error when I do it: A data source instance has not been supplied for the data source "blah"
I'm trying to define "blah" in my code behind at runtime.
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
  ReportViewer1.LocalReport.ReportPath = ReportFile;
  ReportViewer1.LocalReport.DataSources.Clear();
  Microsoft.Reporting.WebForms.ReportDataSource rds = new Microsoft.Reporting.WebForms.ReportDataSource();
  rds.Name = "blah";
  ReportViewer1.LocalReport.DataSources.Add(rds);
  ReportViewer1.DocumentMapCollapsed = true;
  ReportViewer1.LocalReport.Refresh();

this is not working by a long shot. I'm not sure what I'm supposed to do. here is an extract of the top of my rdl file:
  <DataSource Name="blah">
      <rd:DataSourceID>c6a8409e-71a4-4e96-86ad-b300a5b942c3</rd:DataSourceID>
      <ConnectionProperties>
        <DataProvider>SQL</DataProvider>
        <ConnectString>Data Source=10.555.121.121;Initial Catalog=blah</ConnectString>
        <IntegratedSecurity>true</IntegratedSecurity>
      </ConnectionProperties>
    </DataSource>
  </DataSources>

All I'm trying to do is simply select * from a table in "blah" in my report. I need this to work because I have many other report instances I need to show inside my ReportViewer. Why doesn't Microsoft make this easier?
Thanks in advance anybody...

A: The ReportViewer control is designed to work in local mode with RDLC report files, not RDL report files. The ReportViewer control is only intended to render the report and therefore ignores any dataset and connection information that may be present (i.e. if you use an RDL file instead of an RDLC file). The intention is that you create any connections, query data sources, put the results in DataTables and add these to create the reportDataSource(s) for the reportViewer control in the calling application.
From MSDN:

In local processing mode, the control opens a report definition,
  processes it, and then renders the report in the view area. In local
  processing mode, you can get the report definition from a .rdlc file
  on the file system, from a stream, or from an embedded resource in
  your application.

More information: Adding and Configuring the ReportViewer Controls
See also: When to use RDLC over RDL reports?


text:
Q: PropertyGrid with same childs and different nodes I want my custom PropertyGrid with student1 and student2 as nodes with "Name,Section,Percentage,School" as childs for both nodes.
I tried like this :
class StudentClass
{
    private string name;
    private string section;
    private string percentage;
    private string school;

    [CategoryAttribute("Student1")]
    public string School
    {
        get { return school; }
        set { school = value; }
    }
    [CategoryAttribute("Student1")]
    public string Percentage
    {
        get { return percentage; }
        set { percentage = value; }
    }
    [CategoryAttribute("Student1")]
    public string Section
    {
        get { return section; }
        set { section = value; }
    }
    [CategoryAttribute("Student1")]
    public string Name
    {
        get { return name; }
        set { name = value; }
    }
    private string name1;
    [CategoryAttribute("Student2")]
    public string Name1
    {
        get { return name1; }
        set { name1 = value; }
    }
    private string section1;
    [CategoryAttribute("Student2")]
    public string Section1
    {
        get { return section1; }
        set { section1 = value; }
    }
    private string percentage1;
    [CategoryAttribute("Student2")]
    public string Percentage1
    {
        get { return percentage1; }
        set { percentage1 = value; }
    }
    private string school1;
    [CategoryAttribute("Student2")]
    public string School1
    {
        get { return school1; }
        set { school1 = value; }
    }
}

 public Form1()
    {
        InitializeComponent();
        StudentClass sc = new StudentClass();
        propertyGrid1.SelectedObject = sc1;
    }

The Output is as shown below :

Now in the above picture for Student2 instead of "Name1,Section1,Percentage1,School1" I want to display same as student1.
But I didn't get the required output. So Kindly help me out of this.
I am using C# Winforms in VS2010
And Suggest me how to deny columns resizing i.e., I should not allow user to resize the columns.

A: You can use the DisplayName attribute:
private string name1;
[CategoryAttribute("Student2"), DisplayName("Name")]
public string Name1
{
    get { return name1; }
    set { name1 = value; }
}

But note that if the user puts the property grid into A-Z mode, they'll both end up next to each other with no real way to tell them apart.  You may find there's a more appropriate way to represent your data.


text:
Q: php code for determing an mpeg-4 files codecs I need to run checks on .mp4 files to check if they have a h.264 codec to create a php condition or at least just to print  the codecs. Is there some fairly simple code that will run in a html file?

A: Using:

*

*https://code.google.com/p/php-mp4info/
This is their example test file:
include "MP4Info.php";

print '
MP4Info test script
';
print '
'.__FILE__.' $Id: test.php 2 2009-06-11 14:12:31Z lacroix.tommy@gmail.com $
';
print '
';

$dir = './TestFiles/';
$de = opendir($dir);
if ($de) {
    while (($file = readdir($de)) !== false) {
        $path = $dir.$file;
        if ((!is_file($path)) || (!is_readable($path)) || (strtolower(pathinfo($path,PATHINFO_EXTENSION) != 'f4v'))) continue;

        print '
'.$file.'
';
        print "
";
        try {
            print_r(MP4Info::getInfo($path));
        } catch (MP4Info_Exception $e) {
            print 'Caught MP4Info_Exception with message '.$e->getMessage();
            throw ($e);
        } catch (Exception $e) {
            print 'Cauth Exception with message '.$e->getMessage();
            throw ($e);
        }
        print "
";
        print '
';
    }
} else {
    print 'Could not open directory "'.$dir.'".';
}

It does support finding out if video has h.264 encoding.


text:
Q: Regex in Notepad++ to find lines without exactly 9 pipes I have a CSV that I need to clean up before reading it into a table. It is a pipe-delimted, 10-column structure. The challenge is, in some records, the 9th column has carriage returns. I need to replace those CRLF instances with a string of symbols (as place holders) such as #$%, but I only need to replace the CRLFs that are within the 9th column, for each record.
So in this example:
Susan|Ward    |1     |1          |1     |1     |0     |||3250905
Allen|Doe|4     |1          |1     |1     |0     ||
some text
text
more text in the same column|3250061
Mary|James|4     |1          |1     |1     |0     |||3250061     Albert|Nordling|1     |1          |1     |0     |0     |||900434
Henry|Johnson|1     |1          |1     |0     |0     |||900434
Tony|Anderson    |1     |1          |1     |1     |0     |||3250905

The records for Susan, Henry and Tony all have 9 pipes, but Allen's has CRLFs instances (in Notepad++) that need to be replaced to "pull" them all up to the same line to get that record all on one line.
Additionally, Mary's and Albert's records are both on one line together. I need to be able to find those as well so I can split them.
So a regex to find lines that do not have exactly 9 pipes would do the trick.
I can find the records with the 9th column on multiple lines with this regex:
^[^|]*$

But I can't figure out how to find all lines that do not have 9 pipes (10 columns). This won't work:
^[^|{9}]*$

What would do this?
One specific point: If at all possible, I need to be able to have the search select an entire block of lines (which would be each record) that don't have 9 pipes. So in my example, the line that starts with Allen, a search in Notepad++ would highlight that line and the following 3 lines. The regex ^[^|]*$ would select all three lines after the Allen line, as that's looking for lines without pipes at all.

A: You can use this expression to match lines with exactly 10 columns:
^([^|\n]*\|){9}[^|\n]*$
You can test it here
Where:

*

*^ ... $ match beginning and end of a line

*[^|\n]* matches content of a column (no | and no new line; can even be empty)

*\| matches pipe (need to be escaped

Matching lines with less then nine columns:
^([^|\n]*\|){0,8}[^|\n]*$
Matching lines with less then nine columns:
^([^|\n]*\|){10,1000}[^|\n]*$
Update
Playing around a bit this seems to work to find rows with not exactly 10 columns (9 |):
(^([^|\r\n]*\|){0,8}[^|\r\n]*$)|(^([^|\r\n]*\|){10,1000}[^|\r\n]*$)
Test it here


text:
Q: Dowsing chart book with Tikz I works between science and geobiology in France and I would like to create custom dowsing charts which would looks like this exemple :

Or

Actually I am not really skilled in programming and I am a simple user of latex, so i might need help to start with this.
Maybe  anyone have in mind some clues / exemples to look on to get this working with TikZ.
In my mind I would like to enter a list of terms, and that the TikZ script automatic  split into angle angle sections with automation.

A: Welcome! It is not too difficult to draw something like that. One way to do that is to define a pic and repeat it over and over. What is, however, a bit cumbersome is to punch in texts from a screen shot. So I replaced some of them by generic texts.
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{arrows.meta,bending,decorations.text,positioning}
\begin{document}
\begin{tikzpicture}[font=\sffamily,node distance=1ex,
    pics/pilz/.style={code={
     \tikzset{pilz/.cd,#1}
     \def\pv##1{\pgfkeysvalueof{/tikz/pilz/##1}}%
     \draw[pic actions] (\pv{alpha}+\pv{beta}/2:\pv{r}) -- (\pv{alpha}+\pv{beta}/2:\pv{R})
      foreach \XX in {1,...,\pv{n}}
      {to[out=0,in=-120]
        ({{\pv{alpha}+\pv{beta}/2-\XX*\pv{beta}/\pv{n}+\pv{beta}/(2*\pv{n})}}:\pv{xi}*\pv{R})
      to[out=-60,in=180]
        ({\pv{alpha}+\pv{beta}/2-\XX*\pv{beta}/\pv{n}}:\pv{R})}
      -- (\pv{alpha}-\pv{beta}/2:\pv{r});
      \path[decorate,decoration={text along path, text=\pv{text},text align=center}]
      (\pv{alpha}+\pv{beta}/2:\pv{r}/2+\pv{R}/2)
      arc[start angle=\pv{alpha}+\pv{beta}/2,end angle=\pv{alpha}-\pv{beta}/2,
       radius=\pv{r}/2+\pv{R}/2];
    }},pilz/.cd,r/.initial=1,R/.initial=2,alpha/.initial=90,
    beta/.initial=45,xi/.initial=1.1,text/.initial={},n/.initial=1]
 \path foreach \Y [count=\X] in {fox,marmot,cat,koala,bear,duck,mouse,%
 anteater,rhino,hippo,lion,tiger,lynx,owl}
  {pic[rotate={90+180/28-180*\X/14}]{pilz={beta=180/14,r=5,R=6.5,text=|\sffamily|\Y}}
  };
 \foreach \X in {-10,...,10}
 {\pic[rotate={-180*\X/21},fill=gray!25]{pilz={beta=180/21,r=4,R=5,xi=1.05}};
  \path   (90-180*\X/21:4.7)node{$\mathsf{\X}$};
 }
 \path foreach \Y [count=\X] in {mental,spiritual,overall,physical,eotional}
  {pic[rotate={90+180/10-180*\X/5},fill=white]{pilz={beta=180/5,n=3,r=3,R=4,xi=1.05,
    text=|\sffamily|\Y}}
  };
 \path foreach \Y [count=\X] in {astral,etheric,celestial,karmic,univeral}
  {pic[rotate={90+180/10-180*\X/5},fill=gray!25]{pilz={beta=180/5,n=3,r=2,R=3,xi=1.05,
    text=|\sffamily|\Y}}
  };
 \path foreach \Y [count=\X] in {critical,poor,fair,good,excellent}
  {pic[rotate={90+180/10-180*\X/5},fill=white]{pilz={beta=180/5,n=3,r=1,R=2,xi=1.05,
    text=|\sffamily\tiny|\Y}}
  };
 \draw foreach \X in {0,...,5}
 {(\X*180/5:0.5) --(\X*180/5:1.5)};
 \draw[fill] (0.5,0) arc[start angle=0,end angle=180,radius=0.5];
 \path (0,0) node[below=1ex] (L){level of health}
  node[below=of L] (B){bodies}
  node[below=of B] (P){percentage of health}
  node[below=of P] (O){organs of the body};
 \foreach \X/\Y [count=\Z] in {L/1.25,B/2.5,B/3.5,P/4.5,O/5.75}
 {\draw[thick,-{Latex[bend,length=2mm]}] (\X) -- (\Y-0.1*\Z,0|-\X) to[bend right=15] (\Y,0);
 \draw[thick,-{Latex[bend,length=2mm]}] (\X) -- (-\Y+0.1*\Z,0|-\X) to[bend left=15] (-\Y,0);}
\end{tikzpicture}
\end{document}


text:
Q: Proving that a matrix product is singular I just played around in mathematica and found out that it seems like if $A$ is an $m\times n$ matrix and B is an $n\times m$ matrix, with $m>n$, then $AB$ is singular. How does one go about proving this?

A: Looking at these matrices as maps, we have that $\;B:\Bbb F^m\to\Bbb F^n\;$ , and thus $\;\dim\text{Im}\,B\le n\;$ , so $\;\dim\text{Im}\,A(B)\;\le n$ .
Or shortly: linear maps (or matrices) cannot increase the dimension of the domain.


text:
Q: Database.EnsureCreated does not seem that it's creating a database (xamarin.forms) I'm making a simple app using EntityFramework and Sqlite as database to add and save the person into the data base and add it to a ListView, or delete it.
I have a Db class, and in the constructor method i used the method called
Database.EnsureCreated()
to make my database. And in the MainPage.xaml.cs i made an instance of the Db class(db) and i wanted to get all the Workers table in my database and pass it as the ItemSource of a ListView. Also i'm doing these in OnAppearing() method to show my ListView items on the startup, but i face this exception error:

Microsoft.Data.Sqlite.SqliteExceptions: 'SQLite Error 1: 'no such table:Workers'.'

(see the image below)
enter image description here
That it seems the Database.EnsureCreated() is not creating my database.
or maybe it creates my database but it can't create the tables for some reasons and i want to know those reasons
And here's my Db class:
enter image description here
And this is my db_path:
Android:
        string FileName = "Workers.sqlite";
    string FileLocation = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
    string db_path = Path.Combine(FileLocation, FileName);

And the iOS:
            string FileName = "Workers.sqlite";
        string FileLocation = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "..", "Library");
        string db_path = Path.Combine(FileLocation, FileName);

So what is the problem with the database and table creation?

A: I just added using keyword to those lines and it fixed it unexpectedly.
(I also removed some of those db_path variables and made the db_path source cleaner and more fluent by getting it from the App class).
Now the code looks like this:
        using (Db db = new Db(App.db_path))
        {
            List<Worker> AllWorkers = db.Workers.ToList();
            WorkersListView.ItemsSource = AllWorkers;
        }


text:
Q: How to override a route in MVC 5 I've two controller controllerOne is defined under an area AreaOne . I need to reroute one of the action defined in the controllerOne to the action defined in controllerTwo I tried attribute routing but its not working. my current code is given below
Action In Controller One
 public class ControllerOne
    {   public ActionResult CustomerSearch()
    {

                return View("Search", model);
    }
}

Action In Controller Two
[Route("AreaOne/ControllerOne/CustomerSearch")]
     public class ControllerTwo
        {   public ActionResult CustomCustomerSearch()
        {

                    return View("Search", model);
        }
    }

How can I achieve this.?

A: In RouteConfig.cs you can use routes.MapRoute to associate your URL with any controller & action in your project.
            routes.MapRoute(
                name: "OverrideCustomerSearch",
                url: "AreaOne/ControllerOne/CustomerSearch",
                defaults: new { controller = "Two", action = "CustomCustomerSearch" }
        );


text:
Q: Cannot start application in WebSphere when jars in the ear file don't have versions in their filename I have to modify the ear file so that the jar files that it contains don't have any version number in their filename.
For example commons-io.jar instead of commons-io-2.4.jar.
For that I used the expression <fileNameMapping>no-version</fileNameMapping> in the pom file.
With the version in the filenames, the application starts in WebSphere without problems.
Unfortunately, without the version I get the following error:
[11/11/14 9:23:24:131 CET] 000000ed ComponentData E   CWMDF0015E: The class loader cannot load the com.service.ejb3.ejb.MonitoringRemote interface on the com.service.ejb3.ejb.MonitoringImpl Enterprise JavaBeans (EJB) file.
[11/11/14 9:23:24:132 CET] 000000ed AbstractEJBRu E   WSVR0040E: addEjbModule failed for service-ejb3.jar
com.ibm.ejs.container.EJBConfigurationException: CWMDF0015E: The class loader cannot load the com.service.ejb3.ejb.MonitoringRemote interface on the com.service.ejb3.ejb.MonitoringImpl Enterprise JavaBeans (EJB) file.
    at com.ibm.ws.metadata.ComponentDataObject.setInterfacesFromImplements(ComponentDataObject.java:899)
    at com.ibm.ws.metadata.ComponentDataObject.finishCDO(ComponentDataObject.java:458)
    at com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.createBeanMetaData(AbstractEJBRuntime.java:2212)
    at com.ibm.ws.ejbcontainer.runtime.AbstractEJBRuntime.startModule(AbstractEJBRuntime.java:737)
    at com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:3588)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1164)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1369)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:967)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:770)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1361)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2162)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:446)
    at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:389)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:117)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:664)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5468)
    at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5594)
    at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:678)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:622)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1251)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:69)
    at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:272)
    at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1152)
    at java.security.AccessController.doPrivileged(AccessController.java:298)
    at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)
    at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1146)
    at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:999)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:847)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:783)
    at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
    at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)
    at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:241)
    at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:578)
    at org.apache.struts.action.RequestProcessor.processActionPerform(Unknown Source)
    at org.apache.struts.action.RequestProcessor.process(Unknown Source)
    at org.apache.struts.action.ActionServlet.process(Unknown Source)
    at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:960)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1064)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1385)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:194)
    at org.apache.struts.action.RequestProcessor.doForward(Unknown Source)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(Unknown Source)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(Unknown Source)
    at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Unknown Source)
    at org.apache.struts.action.RequestProcessor.process(Unknown Source)
    at org.apache.struts.action.ActionServlet.process(Unknown Source)
    at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
    at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistance(WSCUrlFilter.java:955)
    at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:504)
    at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:325)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:960)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1064)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:914)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:84)
    at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1819)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1702)

A: Your EJB module cannot find the interface:
CWMDF0015E: The class loader cannot load the com.service.ejb3.ejb.MonitoringRemote

It is probably defined in the other JAR. You need to fix classpath in the Manifest.MF file for your EJB module to point to correct jar. Probably due to omitting version names, the file name has changed and cannot be found any more.


text:
Q: How to enforce date formats in Sparx Systems Enterprise Architect UML Stereotypes' Defined Tag Types? If I have a Defined Tag Type, called "published date" for a Stereotype called "wiki article" with:
Type=DateTime;
BaseStereotype=wikiarticle;
Then Sparx pulls the date format from the User Desktop preferences of the Individual user and then stores a string in the t_objectproperties table. The result is a mix of different date types like:
1/9/2017
02/02/2018
2018-02-21
Where only the last one (ISO 8601 is unambiguous).
Is there way I can enforce these data formats the in Sparx?

A: Its not possible within Enterprise Architect.
But for one othe the customer we did it through an addin.
All you need to do is define a tagged value with Type=AddinBroadcast
and in your addin add the broad cast event EA_OnElementTagEdit
public void EA_OnElementTagEdit(EA.Repository Repository, int ObjectID, String TagName, String TagValue, String TagNotes)
{
    DatetimePickerForm form = new DatetimePickerForm(); //Form designed for time picker
    form.ShowDialog();

    // Assign values for TagName,TagValue and TagNotes
}

And if you clicked that tagged value a datetime picker similar to EA will be displayed.

Format of the datetime picker can be customized.Please refer here for full list of formats


text:
Q: Force leaflet to use a fixed tile zoom level I want leaflet to just use the tiles zoomed to level 20 and disregard the lower zoom level tiles.
Is there any way to make Leaflet use chosen zoom level no matter how much the map is actually zoomed?
I thought that zIndex option of TileLayer would do it but it doesn't seem to do anything (I'm not sure what it's supposed to do).
To say it another way:
I want to be able to zoom still and force Leaflet to use 4 tiles to form one tile of a lower zoom level.
Is the better solution is to just combine the tiles beforehand and then feed those combined tiles to leaflet?


text:
Q: Restrict Microsoft Graph Service Account / Client Credentials I'm developing an application on Microsoft Graph that runs as a daemon, and needs access to many accounts. As a result, I'm using a service account, also known as client credentials (using this method).
I can request the proper scope (calendars.readwrite) however as far as I can see, I cannot restrict to which calendars I have access. In my case, I only need access to the meetingroom calendars, and I'm afraid that organisations will not allow my application if I can also read and write from/to the CEO's calendar.
Is there any way (either while creating the app, or during/after giving admin consent) to restrict my app to only a subset of calendars? Or should I approach this problem differently and (e.g.) not use a service account in the first place?


text:
Q: Why are copying object doesn't affect the first object? I am beginner at java, so I found something has made me confused:
Why when we create something like below:
String name = "Abdelillah";
String editName = name;
editName = "Mohammed";

My question is why the editName doesn't change name object?
But when we use arrays, if we create a reference to the first array, the second affect the first
I need to know why please and thank you

A: In the second line, editName is made to point to the same object as name. Both name and editName point to the string "Abdelillah".
Your mistake may be in thinking that the third line changes the contents of the object that editName points to ("Abdelillah"). Rather, in the third  line,   editName  is made to point to a different object, the string "Mohammed".


text:
Q: JOIN on ID, IF ID doesn't match then match on other columns BigQuery I have two tables that I am trying to join. The tables have a primary and foreign key but there are some instances where the keys don't match and I need to join on the next best match.
I tried to use a case statement and it works but because the join isn't perfect. It will either grab the incorrect value or duplicate the record.
The way the table works is if the Info_IDs don't match up we can use a combination of Lev1 and if the cust_start date is between Info_Start and Info_End
I need a way to match on the IDs and then the SQL stops matching on that row. But im not sure if that is something BigQuery can do.
Customer Table
Cust_ID Cust_InfoID Cust_name   Cust_Start  Cust_Lev1
1111    1           Amy         2021-01-01  A
1112    3           John        2020-01-01  D
1113    8           Bill        2020-01-01  D

Info Table
Info_ID Info_Lev1   Info_Start  Info_End    state
1       A           2021-01-15  2021-01-14  NJ
3       D           2020-01-01  2020-12-31  NY
5       A           2021-01-01  2022-01-31  CA

Expected Result
Cust_ID Cust_InfoID Info_ID Cust_Lev1   Cust_Start  Info_Start  Info_End    state
1111    1           1       A           2021-01-01  2021-01-15  2021-01-14  NJ
1112    3           3       D           2020-01-01  2020-01-01  2020-12-31  NY
1112    8           3       D           2020-01-01  2020-01-01  2020-12-31  NY

Join Idea 1:
CASE
  WHEN
    (Cust_InfoID = Info_ID) = true
    AND (Cust_Start BETWEEN Info_Start AND Info_End) = true
  THEN
    Cust_InfoID = Info_ID
  ELSE
    Cust_Start BETWEEN Info_Start AND Info_End
    and Info_Lev1 = Cust_Lev1
END

Output:
Cust_ID Cust_InfoID Info_ID Cust_Lev1   Cust_Start  Info_Start  Info_End    state
1111    1           5       A           2021-01-01  2021-01-01  2022-01-31  CA
1112    3           3       D           2020-01-01  2020-01-01  2020-12-31  NY
1113    8           3       D           2020-01-01  2020-01-01  2020-12-31  NY

The problem here is that IDs match but the dates don't so it uses the ELSE statement to join. This is incorrect
Join Idea 2:
CASE
  WHEN
    Cust_InfoID = Info_ID
  THEN
    Cust_InfoID = Info_ID
  ELSE
    Cust_Start BETWEEN Info_Start AND Info_End
    and Info_Lev1 = Cust_Lev1
END

Output:
Cust_ID Cust_InfoID Info_ID Cust_Lev1   Cust_Start  Info_Start  Info_End    state
1111    1           1       A           2021-01-01  2021-01-15  2021-01-14  NJ
1111    1           5       A           2021-01-01  2021-01-01  2022-01-31  CA
1112    3           3       D           2020-01-01  2020-01-01  2020-12-31  NY
1113    8           3       D           2020-01-01  2020-01-01  2020-12-31  NY

The problem here is that IDs match but the ELSE statement also matches up the wrong duplicate row. This is also incorrect
Example tables here:
with customer as (
    SELECT 1111 Cust_ID,1 Cust_InfoID,'Amy' Cust_name,'2021-01-01' Cust_Start,'A' Cust_Lev1
    UNION ALL
    SELECT 1112,3,'John','2020-01-01','D'
    union all
    SELECT 1113,8,'Bill','2020-01-01','D'
),
info as (
    select 1 Info_ID,'A' Info_Lev1,'2021-01-15' Info_Start,'2021-01-14' Info_End,'NJ' state
    union all
    select 3,'D','2020-01-01','2020-12-31','NY'
    union all
    select 5,'A','2021-01-01','2022-01-31','CA'
)
select Cust_ID,Cust_InfoID,Info_ID,Cust_Lev1,Cust_Start,Info_Start,Info_End,state
from customer
join info on
[case statement here]

A:
The way the table works is if the Info_IDs don't match up we can use a combination of Lev1 and if the cust_start date is between Info_Start and Info_End

Use two left joins, one for each of the conditions:
select c.*,
       coalesce(ii.info_start, il.info_start),
       coalesce(ii.info_end, il.info_end),
       coalesce(ii.state, il.state)
from customer c left join
     info ii
     on c.cust_infoid = ii.info_id left join
     info il
     on ii.info_id is null and
        c.cust_lev1 = il.info_lev1 and
        c.cust_start between il.info_start and il.info_end

A: Consider below ("with one JOIN and a CASE statement" as asked)
select any_value(c).*,
  array_agg(i order by
    case when c.cust_infoid = i.info_id then 1 else 2 end
    limit 1
  )[offset(0)].*
from `project.dataset.customer` c
join `project.dataset.info` i
on c.cust_infoid = i.info_id
or(
  c.cust_lev1 = i.info_lev1 and
  c.cust_start between i.info_start and i.info_end
)
group by format('%t', c)

when applied to sample data in your question - output is


text:
Q: check data if is equal from 2 foreach php i want to check my data like this
data source result from foreach
Data Source => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17

my data for result from foreach is:
ID_1 => 4, 5, 6, 10, 11, 13, 15
ID_2 => 1, 2, 3, 4, 5, 6, 7, 8

how method to check if id is same or equal with data source will result true but if id not have the datasource the result will be false?
here my code to foreach the data
        @php
            $items = array();
            foreach($activity as $a){
                $items[] = $a->id;
            }
            $list = implode(', ', $items);
        @endphp
        Data Source => {{ $list }}

        @foreach($result as $detail_activity)
            ID_{{$detail_activity->id}}  => {{$detail_activity->ActivityDetail}}

        @endforeach

with the result like this
if we use that example data, maybe like
data source | id_1 | id_2 |
1             False True
2             False True
3             False True
4             True  True

thanks for advance :D

A: Assuming $dataSource is an array, e.g.
$dataSource = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ];

And assuming $id_1 and $id_2 are arrays, e.g.:
$id_1 = [ 4, 5, 6, 10, 11, 13, 15 ];
$id_2 = [ 1, 2, 3, 4, 5, 6, 7, 8 ];

To determine whether each element in $dataSources exists in $id_1 or $id_2:
foreach ( $dataSource as $id ) {
    echo $id,
    ( in_array( $id, $id_1 ) ? 'True' : 'False' ),
    ( in_array( $id, $id_2 ) ? 'True' : 'False' ),
    "\n";
}

The better way would be to store the info in the keys of $id_1 and $id_2 and then use the expression $id_1[$id] since that would be faster than in_array().

A: We first create a helper that tells us whether a value exists in a sorted array using binary search (for fast searches).
Helpers.php:(add this file in bootstrap folder)
<?php

function has($needle,$haystack){
    if(!isSorted($haystack)){
        throw new Exception("Sorted array expected but unsorted array given.");
        return;
    }

    $low = 0;
    $high = count($haystack) - 1;
    while($low <= $high){
        $mid = $low + intval(($high - $low) / 2);
        if($haystack[$mid] === $needle) return true;
        if($haystack[$mid] > $needle) $high = $mid - 1;
        else $low = $mid + 1;
    }

    return false;
}

function isSorted($haystack){
    $keys = array_keys($haystack);
    foreach($keys as $index => $key){
        if($index - 1 >= 0 && $haystack[$key] < $haystack[$keys[$index-1]]){
            return false;
        }
    }
    return true;
}

To make these functions available in your project, you need to edit the composer.json like below in the autoload section:
 "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "files": [
           "bootstrap/helpers.php" // <--- this line
        ]
    },

Now, do a composer dump-autoload to autoload this file.
The blade code would be pretty straightforward like below:
@foreach($data_source as $val)
    @if(has($val,$ID_1))

{{ $val }} => ID_1 true

    @else

{{ $val }} => ID_1 false

    @endif
    @if(has($val,$ID_2))

{{ $val }} => ID_2 true

    @else

{{ $val }} => ID_2 false

    @endif
@endforeach

A: solved thanks for every response from you all... sorry if I take a long response
first we create a function
function checkfacility($facility,$datasource){
                        foreach($datasource as $ds){
                            if($facility == $ds->name){
                                return true;
                            }
                        }
                    }

then we made a foreach with condition at blade template like this
@foreach ($facility as $key => $values)
   {{ (checkfacility($values->name,$datasource)) == TRUE ? 'true' : 'false' }}
@endforeach


text:
Q: Excel macro for data reformatting I need to reformat a 33500 row of data in excel. I am trying to write a macro that would do this for me.
I have put some nested loop to solve the issue
Dim i As Integer
Dim m As Integer
Dim n As Integer
Dim K As Integer
Dim p As Integer
Dim c As Integer

For c = 0 To 10

    For n = 5 To 10

        K = 14 + 7 * (n - 5)

        For i = 0 To 7
            m = 14 + 8 * c
            ActiveSheet.Cells(m + i, n).Select
            Selection.Copy

            ActiveSheet.Cells(K + i, 37).Select
            ActiveSheet.Paste
        Next i

    Next n

Next c

I am stuck at how to get this operation done for 32500 rows

A: Excel's Integer has a range of values from -32,768 to 32,767 so formatting 33,500 rows might be a problem.  Assuming that you are happy with how your code works, changing your variable types to Long might be a good start.
BTW, you should avoid SELECTing cells as it slows down the code and can lead to errors.  You can easily copy and paste between cells using soemthing like
Cells(m + i, n).Copy Destination:=Cells(K + i, 37)

A: Revised the code according to the comment and now working like a charm. Thank you so much
Dim i As Integer
Dim m As Integer
Dim n As Integer
Dim K As Integer
Dim p As Integer
For i = 0 To 121
m = 14
   For n = 5 To 35
ActiveSheet.Range(Cells(m + i * 8, n), Cells(m + i * 8 + 7, n)).Copy
Range("AK" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlValues
Next n

Next i
End Sub


text:
Q: Laravel 5: Foreign key constraint is incorrectly formed Estoy intentando crear las siguientes dos tablas con Laravel:

Schema::create('orders', function (Blueprint $table) {
   $table->bigIncrements('id');
   $table->primary('id');
   $table->bigInteger('numPedido')->unsigned();
   $table->string('name', 300);
   $table->string('business', 300)->nullable();
   $table->string('dni', 20);
   $table->string('phone', 20);
   $table->string('address', 300);
   $table->string('cp', 10);
   $table->string('town', 100);
   $table->string('city', 100);
   $table->string('email', 300);
   $table->timestamps();
});

Schema::create('order_items', function (Blueprint $table) {
   $table->bigIncrements('id');
   $table->primary('id');
   $table->bigInteger('order_numPedido')->unsigned();
   $table->foreign('order_numPedido')
         ->references('numPedido')
         ->on('orders')
         ->onDelete('cascade');
   $table->string('name', 300);
   $table->string('quantity', 5);
   $table->string('import', 10);
});

Pero me genera el siguiente error:
General error: 1005 Can't create table `orders` (errno: 150 "Foreign key constraint is incorrectly formed")

No consigo dar con el problema.
Muchas Gracias.

A: El error es por un conflicto con la llave primaria.
No necesitas agregar las líneas $table->primary('id');. Cuando estableces la columna id con $table->bigIncrements('id'); ya se establece como llave primaria.
Puedes ver más información al respecto en la documentación oficial: https://laravel.com/docs/5.5/migrations#columns

A: A la hora de crear los migraciones, recuerda que debes crear primero la tabla/modelo a la cual le vas a relacionar.
php artisan make:model Order -m
php artisan make:model Order-item -m


text:
Q: How to implement a live-searchable table view? Everyone with a mobile device is familiar with table views, searchable scrolling tables where rows have multiple elements like images and text, and are populated from some data source. Since a tableview-based app typically has a MVC design (not FP), it makes sense that  I have never seen this done in Mathematica.
Question: It looks like there is a built-in function called TableView[] but it has no documentation and is rather flakey. Is it exposed for a reason?
There's ListPicker as well, but this doesn't support multiple columns. If the output form representation of DataSet was malleable and scrollable that could work too. But really a good table view implementation has much more: simple design and templating of the rows, fast text fields searching, smooth scrolling with momentum (>= 60FPS), and dynamic listening to underlying data changes. Are there any known examples of this functionality?